﻿package helpers;
/**
 * A convenience class that adds a string to a specific string in a threadsafe way
 * @author Mark Bracke
 */
public class ExecutionString
{
    /**
     * A stringbuilder to make concatenating strings faster
     */
    private final StringBuilder executionString = new StringBuilder();

    /**
     * A getter for the string
     * @return
     */
    public String getString() {
    	return executionString.toString();
    }

    /**
     * Adds a string to the internal stringbuilder in a threadsafe way (synchronized keyword)
     * @param stringToAdd the string to add
     */
    public synchronized void add(String stringToAdd)
    {
        executionString.append(stringToAdd);
    }
}